<!DOCTYPE HTML>
<html lang="en">
<meta charset="utf-8"/>
<head>
    <title>OSS文件上传下载</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<div>
    <div class="upload-ware">
        <form action="./sso/upload" enctype="multipart/form-data" method="post">
            <input type="text" name="filename">
            <input type="file" name="file">
            <input type="submit" name="上传">
        </form>
    </div>

    <div class="preview-ware">
        <img id="previewImg" src="#" alt="预览上传的文件">
        <form action="#">
            <input id="previewUrl" type="text" name="预览文件地址">
            <input id="previewButton" type="button" name="预览">
        </form>
    </div>
</div>

<!-- JS脚本:开始 -->
<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        console.log("初始化脚本....")
        $("#previewButton").onclick(function() {
            var imgUrl = $("#previewUrl").val();
            $("#previewImg").src(imgUrl);
        });
    });
</script>
</body>
</html>